package com.wmh.baseservice.admin.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;

/**
 * @author wmh generator
 * @since 2022-03-21
 */
@ApiModel(value="AdGoods对象", description="平台商品表")
public class AdGoods implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "状态:	0")
    private Integer status;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "版本号")
    @Version
    private Integer version;

    private Date createTime;

    private Date updateTime;

    @ApiModelProperty(value = "分类id")
    private Long categoryId;

    @ApiModelProperty(value = "头图")
    private String avatar;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "轮播图,5张")
    private String img;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "视频")
    private String video;

    @ApiModelProperty(value = "简介")
    private String overview;

    @ApiModelProperty(value = "详情")
    private String content;

    @ApiModelProperty(value = "单价")
    private BigDecimal price;

    @ApiModelProperty(value = "库存")
    private Integer inventory;

    @ApiModelProperty(value = "销量")
    private Integer sale;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "图片路径id")
    private Long urlId;

    @ApiModelProperty(value = "0：无规格 1有规格")
    private Integer hasSpec;

    @TableField(exist = false)
    private String categoryName;

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Long getId() {
        return id;
    }

    public AdGoods setId(Long id) {
        this.id = id;
        return this;
    }
    public Integer getStatus() {
        return status;
    }

    public AdGoods setStatus(Integer status) {
        this.status = status;
        return this;
    }
    public String getRemark() {
        return remark;
    }

    public AdGoods setRemark(String remark) {
        this.remark = remark;
        return this;
    }
    public Integer getVersion() {
        return version;
    }

    public AdGoods setVersion(Integer version) {
        this.version = version;
        return this;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public AdGoods setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }
    public Date getUpdateTime() {
        return updateTime;
    }

    public AdGoods setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }
    public Long getCategoryId() {
        return categoryId;
    }

    public AdGoods setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
        return this;
    }
    public String getAvatar() {
        return avatar;
    }

    public AdGoods setAvatar(String avatar) {
        this.avatar = avatar;
        return this;
    }
    public String getImg() {
        return img;
    }

    public AdGoods setImg(String img) {
        this.img = img;
        return this;
    }
    public String getVideo() {
        return video;
    }

    public AdGoods setVideo(String video) {
        this.video = video;
        return this;
    }
    public String getOverview() {
        return overview;
    }

    public AdGoods setOverview(String overview) {
        this.overview = overview;
        return this;
    }
    public String getContent() {
        return content;
    }

    public AdGoods setContent(String content) {
        this.content = content;
        return this;
    }
    public BigDecimal getPrice() {
        return price;
    }

    public AdGoods setPrice(BigDecimal price) {
        this.price = price;
        return this;
    }
    public Integer getInventory() {
        return inventory;
    }

    public AdGoods setInventory(Integer inventory) {
        this.inventory = inventory;
        return this;
    }
    public Integer getSale() {
        return sale;
    }

    public AdGoods setSale(Integer sale) {
        this.sale = sale;
        return this;
    }
    public String getTitle() {
        return title;
    }

    public AdGoods setTitle(String title) {
        this.title = title;
        return this;
    }
    public Long getUrlId() {
        return urlId;
    }

    public AdGoods setUrlId(Long urlId) {
        this.urlId = urlId;
        return this;
    }
    public Integer getHasSpec() {
        return hasSpec;
    }

    public AdGoods setHasSpec(Integer hasSpec) {
        this.hasSpec = hasSpec;
        return this;
    }

    public static final String ID = "id";

    public static final String STATUS = "status";

    public static final String REMARK = "remark";

    public static final String VERSION = "version";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String CATEGORY_ID = "category_id";

    public static final String AVATAR = "avatar";

    public static final String IMG = "img";

    public static final String VIDEO = "video";

    public static final String OVERVIEW = "overview";

    public static final String CONTENT = "content";

    public static final String PRICE = "price";

    public static final String INVENTORY = "inventory";

    public static final String SALE = "sale";

    public static final String TITLE = "title";

    public static final String URL_ID = "url_id";

    public static final String HAS_SPEC = "has_spec";

    @Override
    public String toString() {
        return "AdGoods{" +
            "id=" + id +
            ", status=" + status +
            ", remark=" + remark +
            ", version=" + version +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            ", categoryId=" + categoryId +
            ", avatar=" + avatar +
            ", img=" + img +
            ", video=" + video +
            ", overview=" + overview +
            ", content=" + content +
            ", price=" + price +
            ", inventory=" + inventory +
            ", sale=" + sale +
            ", title=" + title +
            ", urlId=" + urlId +
            ", hasSpec=" + hasSpec +
        "}";
    }

    public final static String[] getFields(String ...noField){
        List<String> list = new ArrayList<>(Arrays.asList(
            AdGoods.ID
            ,AdGoods.STATUS
            ,AdGoods.REMARK
            ,AdGoods.VERSION
            ,AdGoods.CREATE_TIME
            ,AdGoods.UPDATE_TIME
            ,AdGoods.CATEGORY_ID
            ,AdGoods.AVATAR
            ,AdGoods.IMG
            ,AdGoods.VIDEO
            ,AdGoods.OVERVIEW
            ,AdGoods.CONTENT
            ,AdGoods.PRICE
            ,AdGoods.INVENTORY
            ,AdGoods.SALE
            ,AdGoods.TITLE
            ,AdGoods.URL_ID
            ,AdGoods.HAS_SPEC
        ));
        list.removeAll(new ArrayList<>(Arrays.asList(noField)));
        return list.toArray(new String[0]);
    }
}